<template>
  <div class="app-container">

    <el-table v-loading="listLoading" :data="list" element-loading-text="正在查询中。。。" row-key="id"
              style="width: 100%;margin-bottom: 20px;" border="">

      <el-table-column label="姓名" prop="name"/>

      <el-table-column label="辈分" prop="generation">
        <template slot-scope="scope">
          {{ scope.row.generation}}
        </template>
      </el-table-column>

      <el-table-column label="图片" prop="img">
        <template slot-scope="scope">
          <img :src="scope.row.img" min-width="70" height="70"/>
        </template>
      </el-table-column>
    </el-table>

  </div>
</template>

<script>
  export default {
    name: "TableTree",
    typeFilter(status) {
      const typeMap = {
        '1': '省',
        '2': '市',
        '3': '区'
      }
      return typeMap[status]
    },
    data() {
      return {
        list: [],
        listLoading: true,
        downloadLoading: false
      }
    },
    created() {
      this.getList()
    },
    methods: {
      getList() {
        this.listLoading = true
        this.getRequest("/allMenu").then(response => {
          this.list = response.data;
          this.listLoading = false
        }).catch(() => {
          this.list = []
          this.listLoading = false
        })
      }
    }
  }
</script>

<style scoped>

</style>
